package org.testmyapp.entities;

public class TariffInstancePk {

	public InsuredPersonPk ip;
	public Integer tarif;

	public TariffInstancePk() {

	}

	public TariffInstancePk(InsuredPersonPk ip, int tarif) {
		this.ip = ip;
		this.tarif = tarif;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (!other.getClass().equals(this.getClass())) {
			return false;
		}
		TariffInstancePk otherObject = (TariffInstancePk) other;
		if (otherObject == this) {
			return true;
		}
		if (ip != null && otherObject.ip != null
				&& ip.equals(otherObject.ip)) {
			if (tarif != null && otherObject.tarif != null
					&& tarif.equals(otherObject.tarif)) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		if(ip == null || tarif == null) {
			return 0;
		}
		else {
			return ip.hashCode() ^ tarif.hashCode();
		}
	}

	
}
